<template>
  <div class="home col">
    <span>测试测试测试</span>
    <button @click="back">返回两次</button>

    <HooksTest v-bind="paramsBind" v-on="glgg.bindEvent" />

    <button @click="glgg.clear()">清空</button>
  </div>
</template>

<script lang="ts">
import {defineComponent, ref} from 'vue'
  import { ActionSheet } from 'vant'
  import router from '@/router'
  import HooksTest from './HooksText'
  import { useTestHook } from '@/views/Test/hooksss'

  export default defineComponent({
    name: 'Home',
    components: {
      [ActionSheet.name]: ActionSheet,
      HooksTest
    },
    setup() {
      const back = () => {
        router.go(-2)
      }

      const glgg = useTestHook()

      const value1 = ref(1)
      const value2 = ref(1)

      const paramsBind = {
        params1: value1,
        params2: value2
      }

      return {
        back,
        glgg,
        paramsBind
      }
    }
  })
</script>

<style scoped></style>
